<template>
  <a-modal
    :visible="visible"
    title="学籍异动信息审核"
    :width="1000"
    style="top:20px;"
    :confirmLoading="loading"
    :bodyStyle="{
      height: '75vh',
      overflow: 'auto'
    }"
    @cancel="() => { $emit('close') }"
  >
    <a-form :form="form" layout="vertical">
      <template v-if="transferInfo.ydly === '1'">
        <a-row :gutter="48">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="学号"
            >
              {{ studentInfo.xh }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动类型"
            >
              <a-select disabled :getPopupContainer="trigger => trigger.parentNode" v-decorator="['ydlbm',
                {
                  rules: [{ required: true, message: '请选择异动类型!' }]
                }]" allowClear>
                <a-select-option v-for="i in TYPE0070" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col v-if="studentInfo && studentInfo.ydlbm === '60'" :md="12" :sm="24">

          </a-col>
          <a-col v-if="studentInfo && studentInfo.ydlbm === '60'" :md="12" :sm="24">
            <a-form-item
              label="延长学习年限"
            >
              <a-select disabled v-decorator="['ycnx',{
                  rules: [{ required: true, message: '请选择延长学习年限!' }],
                }]">
                <a-select-option value="0.5">0.5</a-select-option>
                <a-select-option value="1">1</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动原因"
            >
              <a-select disabled :getPopupContainer="trigger => trigger.parentNode" v-decorator="['ydyym']" allowClear>
                <a-select-option v-for="i in selectMenu.ydyy" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动日期"
            >
              <a-date-picker disabled v-decorator="['ydrq',
                {
                  rules: [{ required: true, message: '请选择异动日期!' }]
                }]" style="width: 100%"/>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="姓名"
            >
              {{ studentInfo.yxm }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后姓名"
            >
              <a-input disabled :style="{color: studentInfo.yxm !== studentInfo.xxm ? 'red' : ''}" v-decorator="['xxm']"/>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="性别"
            >
              {{ studentInfo.yxbmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后性别"
            >
              <a-select disabled :style="{color: studentInfo.yxbmc !== studentInfo.xxbmc ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xxbm']" allowClear>
                <a-select-option v-for="i in TYPE0011" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="出生日期"
            >
              {{ studentInfo.ycsrq }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后出生日期"
            >
              <a-input disabled :style="{color: studentInfo.ycsrq !== studentInfo.xcsrq ? 'red' : ''}" v-decorator="['xcsrq']"/>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="证件类型"
            >
              {{ studentInfo.yzjlxmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后证件类型"
            >
              <a-select disabled :style="{color: studentInfo.yzjlxm !== studentInfo.xzjlxm ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xzjlxm']" allowClear>
                <a-select-option v-for="i in TYPE0088" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="证件号码"
            >
              {{ studentInfo.yzjhm }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后证件号码"
            >
              <a-input disabled :style="{color: studentInfo.yzjhm !== studentInfo.xzjhm ? 'red' : ''}" v-decorator="['xzjhm']"/>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前院系"
            >
              {{ studentInfo.yyxsmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后院系"
            >
              <a-select disabled :style="{color: studentInfo.xyxsh !== studentInfo.yyxsh ? 'red' : ''}" allowClear showSearch :filterOption="filterOption" v-decorator="['xyxsh']" @change="yxChange">
                <a-select-option v-for="i in selectMenu.yx" :key="i.id" :value="i.dwh">{{ i.dwh }} {{ i.dwmc }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前专业"
            >
              {{ studentInfo.yzymc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后专业"
            >
              <a-select disabled :style="{color: studentInfo.xzyh !== studentInfo.yzyh ? 'red' : ''}" @change="zyChange" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xzyh']" showSearch :filterOption="filterOption" allowClear>
                <a-select-option v-for="i in selectMenu.zy" :key="i.id" :value="i.zyh">{{ i.zyh}} {{ i.zymc }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前导师"
            >
              {{ studentInfo.ydsmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后导师"
            >
              <a-select disabled :style="{color: studentInfo.ydsmc !== studentInfo.xdsmc ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xdsm']">
                <a-select-option v-for="i in selectMenu.tutor" :key="i.dsbh" :value="i.dsbh">{{ i.xm }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前第二导师"
            >
              {{ studentInfo.ydedsmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后第二导师"
            >
              <a-select disabled :style="{color: studentInfo.ydedsmc !== studentInfo.xdedsmc ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xdedsm']">
                <a-select-option v-for="i in selectMenu.tutor" :key="i.dsbh" :value="i.dsbh">{{ i.xm }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前培养层次"
            >
              {{ studentInfo.ypyccmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后培养层次"
            >
              <a-select disabled :style="{color: studentInfo.ypycc !== studentInfo.xpycc ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xpycc']" allowClear>
                <a-select-option v-for="i in TYPE0310" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前学制"
            >
              {{ studentInfo.yxz }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后学制"
            >
              <a-select disabled :style="{color: studentInfo.yxz !== studentInfo.xxz ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xxz']" allowClear>
                <a-select-option v-for="i in TYPE0301" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前学籍状态"
            >
              {{ studentInfo.yxjztmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后学籍状态"
            >
              <a-select disabled :style="{color: studentInfo.yxjztmc !== studentInfo.xxjztmc ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xxjzt']" allowClear>
                <a-select-option v-for="i in TYPE0073" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="当前所在年级"
            >
              {{ studentInfo.ynjmc }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后所在年级"
            >
              <a-select disabled :style="{color: studentInfo.ynj !== studentInfo.xnj ? 'red' : ''}" :getPopupContainer="trigger => trigger.parentNode" v-decorator="['xnj']" allowClear>
                <a-select-option v-for="i in TYPE0126" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动前毕业年月"
            >
              {{ studentInfo.ybyny && studentInfo.ybyny.format('YYYY-MM-DD') }}
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="异动后毕业年月"
            >
              <a-select disabled :style="{color: (typeof studentInfo.ybyny === 'object' && studentInfo.ybyny.format('YYYY-MM-DD')) !== studentInfo.xbyny ? 'red' : ''}" v-decorator="['xbyny']" allowClear>
                <a-select-option v-for="i in graduateYearList" :key="i" :value="i">{{i}}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
        </a-row>
        <a-form-item label="异动备注" :labelCol="{span: 4,offset: 1}" :wrapperCol="{span: 19}">
          <a-input disabled type="textarea" v-decorator="['note']" :autosize="{ minRows: 4, maxRows: 6 }"/>
        </a-form-item>
      </template>

      <template v-if="transferInfo.ydly === '2'">
        <detail-list :col="2">
          <detail-list-item term="异动类型">{{ transferInfo.ydlbmc }}&emsp;</detail-list-item>
          <detail-list-item term="异动原因">{{ transferInfo.ydyymc }}&emsp;</detail-list-item>
          <detail-list-item term="培养单位">{{ transferInfo.yyxsmc }}&emsp;</detail-list-item>
          <detail-list-item term="学号">{{ transferInfo.xh }}&emsp;</detail-list-item>
          <detail-list-item term="专业">{{ transferInfo.yzymc }}&emsp;</detail-list-item>
          <detail-list-item term="指导教师姓名">{{ transferInfo.ydsmc }}&emsp;</detail-list-item>
          <detail-list-item term="姓名">{{ transferInfo.yxm }}&emsp;</detail-list-item>
          <detail-list-item term="性别">{{ transferInfo.yxbmc }}&emsp;</detail-list-item>
          <detail-list-item term="入学时间">{{ transferInfoDetail.rxny && transferInfoDetail.rxny.format('YYYY-MM') }}&emsp;</detail-list-item>
          <detail-list-item term="原定毕业时间">{{ transferInfo.ybyny && transferInfo.ybyny.slice(0, 7) }}&emsp;</detail-list-item>
          <detail-list-item term="培养类型">{{ transferInfoDetail.pylx }}&emsp;</detail-list-item>
          <detail-list-item v-if="transferInfo.ydlbm === '12' || transferInfo.ydlbm === '11'" term="休学起止时间">{{ transferInfo.xxkssj && transferInfo.xxkssj.slice(0, 10) }} - {{ transferInfo.xxjssj && transferInfo.xxjssj.slice(0, 10) }}</detail-list-item>
          <detail-list-item v-if="transferInfo.ydlbm === '12'" term="复学时间">{{ transferInfo.fxsj && transferInfo.fxsj.slice(0, 10) }}&emsp;</detail-list-item>
          <detail-list-item term="预计毕业年月">{{ transferInfo.xbyny && transferInfo.xbyny.slice(0, 7) }}&emsp;</detail-list-item>
          <detail-list-item term="联系方式">{{ transferInfo.lxfs }}&emsp;</detail-list-item>
          <detail-list-item term="入学前单位">{{ transferInfo.rxqdw }}&emsp;</detail-list-item>
          <detail-list-item v-if="transferInfo.ydlbm === '60'" term="延长年限">{{ transferInfo.ycnx }}&emsp;</detail-list-item>
        </detail-list>
        <p>申请理由</p>
        <p>{{ transferInfo.ydsm }}</p>
        <p>附件</p>
        <p>
          <img v-for="tp in transferInfo.ydtp&&transferInfo.ydtp.split(',')" :key="tp" :src="`${IMGURL}${tp}`" alt="">
        </p>
      </template>
      <a-form-item
        label="申请单上传"
        extra="上传已盖完章的申请单"
        v-if="checkType === '培养单位'"
      >
        <a-upload
          v-decorator="['applicationForm']"
          :action="uploadUrl"
          list-type="picture"
          :headers="{
            Authorization: this.$store.state.account.token
          }"
          @change="handleFileChange"
          :showUploadList="false"
        >
          <img v-if="imageUrl" :src="`${IMGURL}${imageUrl}`" style="width: 200px;height: 200px;" alt="avatar" />
          <a-button v-else>
            <div class="ant-upload-text">上传照片</div>
          </a-button>
        </a-upload>
      </a-form-item>
      <a-form-item label="审核备注" :labelCol="{span: 4,offset: 1}" :wrapperCol="{span: 19}">
        <a-input type="textarea" v-decorator="['explain']" :autosize="{ minRows: 4, maxRows: 6 }"/>
      </a-form-item>
    </a-form>
    <template slot="footer">
      <a-button type="danger" @click="changeTransfer(checkDict.rejectCode)">拒绝</a-button>
      <a-button type="primary" @click="changeTransfer(checkDict.passCode)">通过</a-button>
      <a-button @click="back()">关闭</a-button>
    </template>
  </a-modal>
</template>
<script>
import {mapState} from 'vuex'
import moment from 'moment'
import { debounce } from 'utils/common'
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item
// function getBase64 (img, callback) {
//   const reader = new FileReader()
//   reader.addEventListener('load', () => callback(reader.result))
//   reader.readAsDataURL(img)
// }
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    transferInfo: {
      type: Object,
      default: () => {
        return {}
      }
    },
    queryParam: {
      type: Object,
      default: () => {
        return {}
      }
    },
    initDone: {
      type: Boolean
    },
    checkType: {
      type: String,
    }
  },
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      // uploadUrl: `http://139.159.241.187:9095/upload/formImg`,
      uploadUrl: `${process.env.SERVICE_URL}upload/formImg`,
      IMGURL: process.env.IMG_URL,
      queryForm: {},
      studentInfo: {},
      selectMenu: {},
      loading: false,
      imageUrl: '',
      graduateYearList: [],
      transferInfoDetail: {}
    }
  },
  computed: {
    ...mapState({
      TYPE0070: state => state.app['TYPE0070'], // 异动类型
      // TYPE0302: state => state.app['TYPE0302'], // 异动原因
      TYPE0011: state => state.app['TYPE0011'], // 性别
      TYPE0088: state => state.app['TYPE0088'], // 证件类型
      TYPE0310: state => state.app['TYPE0310'], // 培养层次
      TYPE0301: state => state.app['TYPE0301'], // 学制
      TYPE0073: state => state.app['TYPE0073'], // 学籍状态
      TYPE0126: state => state.app['TYPE0126'] // 年级
    }),
    checkDict () {
      return {
        routeName: this.$route.name,
        passCode: this.$route.name === '主管院长学籍异动审核' ? '06' : (this.$route.name === '研究生院长学籍异动审核' ? '08' : '02'),
        rejectCode: this.$route.name === '主管院长学籍异动审核' ? '07' : (this.$route.name === '研究生院长学籍异动审核' ? '09' : '03'),
        apiFn: this.$route.name === '主管院长学籍异动审核' ? 'transferingzgCheck' : (this.$route.name === '研究生院长学籍异动审核' ? 'transferingyzCheck' : 'transferingCheck')
      }
    }
  },
  watch: {
    transferInfo (val) {
      if (val) {
        this.imageUrl = ''
        this.$api.student.transferingInfoById(val.id).then(res => {
          this.transferInfoDetail = res.data
          let yxm = res.data.xyxsh
          if(!yxm){
            yxm = res.data.yyxsh
          }
          let zym = res.data.xzyh
          if(!zym){
            zym = res.data.yzyh
          }
          this.initSelectMenu(yxm, zym)
          if (res.data.xyxsh) {
            this.yxChange(res.data.xyxsh, true)
          }
          this.studentInfo = res.data
          this.ydlbChange(res.data.ydlbm)
          if (val.initSearch) {
            this.$emit('update:queryParam', {
              xh: this.studentInfo.xh
            })
            this.$emit('update:initDone', true)
          }
          this.$nextTick(() => {
            this.form.resetFields()
            for (const key in this.studentInfo) {
              if (['xcsrq', 'xbyny', 'ydrq', 'ycsrq', 'ybyny'].includes(key)) {
                this.studentInfo[key] = moment(this.studentInfo[key])
              }
            }
            if (this.studentInfo.xbyny) {
              this.studentInfo.xbyny = this.studentInfo.xbyny.format('YYYY-MM-DD')
            }
            if (this.studentInfo.ycsrq) {
              this.studentInfo.ycsrq = this.studentInfo.ycsrq.format('YYYY-MM-DD')
            }
            if (this.studentInfo.xcsrq) {
              this.studentInfo.xcsrq = this.studentInfo.xcsrq.format('YYYY-MM-DD')
            }
            this.form.setFieldsValue(this.studentInfo)
          })
        })
      } else {
        this.form.resetFields()
      }
    }
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  created() {
    const curYear = new Date().getFullYear()
    function generateYearArray (start, end) {
      let arr = []
      let len = end - start
      for (let index = 0; index < len; index++) {
        arr.push(...[`${start + index}-07-01`,`${start + index}-12-31`])
      }
      return arr
    }
    this.graduateYearList = generateYearArray(curYear-100,curYear+20)
    this.initDictionary()
  },
  methods: {
    initDictionary () {
      this.$store.dispatch('app/setDictionary', 'TYPE0070')
      // this.$store.dispatch('app/setDictionary', 'TYPE0302')
      this.$store.dispatch('app/setDictionary', 'TYPE0011')
      this.$store.dispatch('app/setDictionary', 'TYPE0088')
      this.$store.dispatch('app/setDictionary', 'TYPE0310')
      this.$store.dispatch('app/setDictionary', 'TYPE0301')
      this.$store.dispatch('app/setDictionary', 'TYPE0073')
      this.$store.dispatch('app/setDictionary', 'TYPE0126')
    },
    filterOption (value, op) {
      return op.componentOptions.children[0].text.indexOf(value) !== -1
    },
    initSelectMenu (yxm, zym) {
      let allRequest = [
        this.$api.base.collegeAll(),
        this.$api.student.teacherQueryAll({yxm: yxm, zym: zym})
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          yx: res[0].data,
          tutor: res[1].data
        }
      })
    },
    yxChange (code, init = false) {
      console.log(init)
      if (!init) {
        this.form.setFieldsValue({xzyh: ''})
      }
      if (code) {
        this.$api.base.majorAll({lsdwh: code}).then(res => {
          this.$set(this.selectMenu, 'zy', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'zy', [])
      }
    },
    changeTransfer (code) {
      this.form.validateFields((err, values) => {
        if (err) {
          return this.$message.warn('审核备注不能为空')
        }
        let params = {
          ...values,
          statusCode: code,
          xjydId: this.transferInfo.id,
          explain: values.explain,
          applicationForm: this.imageUrl ? this.imageUrl : this.transferInfoDetail.applicationForm
        }
        this.$DateToString(params)
        this.confirmLoading = true
        // let apiFn = this.isDirector ? 'transferingzgCheck' : 'transferingCheck'
        this.$api.student[this.checkDict.apiFn](params).then(res => {
          this.$message.success(res.msg)
          this.back()
          this.$emit('refresh')
        }).finally(() => {
          this.confirmLoading = false
        })
      })
    },
    fetchYdyy: debounce(async function (typeCode) {
      if(typeCode && typeCode.length > 1){
        let { data } = await this.$api.dict.queryAll({
          typeCode: typeCode
        })
        this.$set(this.selectMenu, 'ydyy', data)
      }
    }),
    ydlbChange(code){
      switch(Number(code)){
        case 1: {
          this.fetchYdyy('TYPE0302')
          break
        }
        case 6:{
          this.fetchYdyy('TYPE0433')
          break
        }
        case 11: {
          this.fetchYdyy('TYPE0431')
          break
        }
        case 12:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 14:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 15:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 16:{
          this.fetchYdyy('TYPE0432')
          break
        }
        case 17:{
          this.fetchYdyy('TYPE0432')
          break
        }
        case 18:{
          this.fetchYdyy('TYPE0432')
          break
        }
        case 21:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 22:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 23:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 42:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 43:{
          this.fetchYdyy('TYPE0440')
          break
        }
        case 51:{
          this.fetchYdyy('TYPE0434')
          break
        }
        case 60:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 62:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 64:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 66:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 68:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 30:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 31:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 32:{
          this.fetchYdyy('TYPE0302')
          break
        }
        case 99:{
          this.fetchYdyy('TYPE0302')
          this.xbynyDisabled =  true
          this.form.setFieldsValue({xxjzt: '99'})
          break
        }
      }
    },
    zyChange(code) {
      this.form.setFieldsValue({xdsm: '', xdedsm: ''})
      this.$api.student.tutorByStu({yxm: this.form.getFieldValue('xyxsh'), zym: code}).then(res => {
        this.$set(this.selectMenu, 'tutor', res.data)
      })
    },
    handleFileChange (info) {
      console.log(info)
      if (info.file.status === 'uploading') {
        this.loading = true
        return
      }
      if (info.file.status === 'done') {
        this.imageUrl = info.file.response.data[0]
        // this.form.setFieldsValue({applicationForm: info.file.response.data[0]})
        // Get this url from response in real world.
        // getBase64(info.file.originFileObj, (imageUrl) => {
        //   this.imageUrl = imageUrl
        //   this.loading = false
        // })
      }
    },
    back(){
      // this.form.resetFields()
      this.$emit('close')
    }
  }
}
</script>

<style lang="less">
  .yddate-picker-wrap {
    input {
      color: red;
    }
  }
</style>
